import unittest
from time import sleep

from common.functions import save_screenshot
from common.decorators import mkdir_classname, log4gs
from common.settings import TAG
from pages_example.gis_createEventsPage import Gis_createEvents


@log4gs
@mkdir_classname(TAG)
class MacManageTest(unittest.TestCase):
    """网格管理功能测试"""
    @classmethod
    def setUpClass(cls):
        cls.log.info('=' * 30 + "开始网格管理功能测试({})".format(__class__.__name__) + '=' * 30)
        cls.page = Gis_createEvents('gisDataEntry/events/createEvents')

    @classmethod
    def tearDownClass(cls):
        cls.log.info('=' * 30 + "结束网格管理功能测试({})".format(__class__.__name__) + '=' * 30)
        cls.page.driver.quit()

    def setUp(self):
        self.log.info('>>>>>开始执行用例：{} {}'.format(self.id(), self.shortDescription()))

    def tearDown(self):
        self.log.info('<<<<<结束执行用例：{} {}'.format(self.id(), self.shortDescription()))

    @unittest.skip
    def test_abc1(self):
            """举例：网格管理5级区域选择器"""
            sleep(1)
            self.page.table.add_btn.click()
            sleep(2)

if __name__ == '__main__':
    unittest.main()